package test07.demo3;

public class Tianshi {
    public void tianshiDoor(Thedoor thedoor){
        thedoor.open();
        System.out.println("天师进出....");
        // 是否具有辟邪的功能
        if (thedoor instanceof Bixie) {
            ((Bixie) thedoor).canBixie();
            System.out.println("具有辟邪的功能");
        } else {
            System.out.println("不具有辟邪的功能");
        }
        thedoor.close();
    }
}
